Welcome Guest, you are in: Login
CTS Futures

Page History: MarketData Request

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2013/01/22 16:59



Subscribing to Streaming Data

The T4 FIX API provides (optional) subscriptions to streaming market data for all markets available in order routing. Market data is made available asynchronously and concurrently to order routing flow. The market data subscriptions are active during a FIX Session. They are initiated by Market Data Request messages (Tag 35=V). A Market Data Request is a general request for streaming of market data quotes on specific securities. Under the T4 FIX API, securities are defined by the Exchange, Contracts within an exchange and Markets for a specific contract. Exchanges are identified by an unique Exchange ID in Tag 207 (SecurityExchange). Contracts are characterized by its Contract ID in Tag 55 (Symbol). Markets are identified by an unique Market ID by Tag 48 (SecurityID).

Any time during a FIX Session, market data subscriptions can be requested for a specific market by specifying a Subscription Request Type (Tag 263=1). During the FIX session, the streaming market data (for any specific security) can be also unsubscribed (Tag 263=2).

A successful Market Data Request (for subscription) returns one or more Market Data messages containing one or more Market Data Entries. Currently, The T4 FIX API provides market updates with the MarketData Snapshot message (Tag 35=W). Market Data Snapshots carry multiple blocks of quote data delineated by Market Data Entries. Each Market Data Entry is a bid, an offer, a trade, the opening, closing, or settlement price of a security, the value of an index, the trading session high price, low price, or trade volume, open interest and low and high price limits. Market Data Entries usually have a price and a quantity (size) at a book level (for securities with market depth). For example, in an order book environment, requesting just the top of book would result in two active Market Data Entries; one for the best bid and one for the best offer. For a full book, the bid and offer sides may each have several Market Data Entries corresponding to multiple book levels.

Market Data requests that cannot be honored are notified via the MarketData Request Reject message.


Subscription Types

The following Subscription Request Types control attributes, initiation and termination of streaming market data:

Subscribe: A Snapshot + Updates subscription (Tag 263=1) causes the current state of the market to be sent, and any updates as they occur, until the client requests that the Snapshot + Updates be unsubscribed.
When Snapshot + Updates is requested, updates may be full or incremental:

Full Refresh: This mode is optimized to trade off increased bandwidth for simplicity in processing and is intended for requests on only a few instruments. Each FIX Market Data message (in response to a market data subscription request) will contain the complete data requested for one instrument.

Incremental Refresh: This mode is not currently implemented in the T4 FIX API . All incremental refreshes are currently sent as MarketData Snapshots. The Incremental Refresh mode is optimized for handling requests for many instruments while conserving bandwidth. Each Market Data Entry is assigned an MDEntryID unique among all other active entries and incremental update operations (e.g. add, delete and change) can be included in one incremental refresh message.

UnSubscribe: Unsubscribing from currently streaming market data is specified with an "Unsubscribe" Subscription Request Type (Tag 263=2).

SnapShot: A Market Data Snapshot (Tag 263=0) causes the current state of the market to be sent. Currently, this subscription type is equivalent to Snapshot + Updates (Tag 263=1). Note that as the current data flow is driven by Market Data Snapshot messages, the complete view of a market may be rendered by a single Market Data Snapshot update. For a complete description of the market, the T4 FIX API also sends a Market Data Snapshot message associated with non-book entries (e.g. Trade Volume, Session high, Session low, etc.).


Data Throughput and Buffering Levels

The T4 FIX API offers several levels of data throughput. The market data subscriber can control the number of quotes and the throughput rate (received by a client application). The T4 FIX API buffers streaming market data flow and disseminates quotes at the level requested by the API client. The following T4 buffering levels are available:

0. Full Refresh: Same as Smart Buffering.

1. Incremental Refresh: Same as Smart Buffering.

2. SlowTrade: Same as SlowSmart buffering plus every individual trade is received as well. It should be used sparingly due to high bandwidth and potentially large number of messages being received during busy market periods.

3. SmartTrade: Same as Smart buffering plus every individual trade is received as well. It should be used sparingly due to high bandwidth and potentially large number of messages being received during busy market.

4. SlowSmart: Slowed down version of Smart buffering for lower bandwidth usage. This produces depth updates about once per second per market if changes have occurred.

5. Smart: Smart buffering, depth is sent out on different buffering intervals dependent on what has changed in the depth. Changes to the best bid, offer or last trade are sent out frequently, changes that are off the market are sent out less frequently.

6. FastSmart: Faster version of Smart buffering. It sends out changes to best bid or offer prices more frequently. Much higher bandwidth usage.

7. All: All depth updates, no buffering. Not supported by API applications. Specifying this subscription level in the API will result in Smart buffering level. Same as FastSmart buffering plus every individual trade is received as well. It should be used sparingly due to high bandwidth and potentially large number of messages being received during busy market periods.

8. FastTrade: Same as FastSmart buffering plus every individual trade is received as well. It should be used sparingly due to high bandwidth and potentially large number of messages being received during busy market periods.

9. TradeOnly: Every individual trade is received, but nothing else - no depth, settlement, highlow, price limits etc.


Book Depth

The T4 FIX API Book Depth controls the number of book levels received for each update. Dependent on the specific security, up to a maximum of 10 book levels are available. The number of levels in the market data book is requested with MarketDepth (Tag 264). Higher number of levels will result in increased bandwidth requirements. If the best bid/offer is just needed for a quote board, a subscription to Level 1 is recommended. If a market is to show all depth lines, subscription to a Market Depth of 10 is required. Even if such security does not support 10 levels of market data, the T4 FIX API will provide the maximum number of levels that security currently supports.


Chart Data Requests

The T4 FIX API provides acccess to Chart (Time-and-Sales) Data primarily for the construction of historical graphs and charts. The data can be time-aggregated by day, hour, minute and second as well as by Tick, Time Price Opportunity (TPO) and Tick Change. As Chart Data requests can potentially be demanding, the amount of data returned depends on the length and granularity of the time window span and the resultant size of the data response. The T4 FIX API optimizes its data transmissions by optionally compressing and encoding FIX API chart data responses.

Requests for Chart Data are performed with the Market Data Request message as is governed by the SubscriptionRequestType (Tag 263). Responses to Chart Data requests are provided with the MarketData Snapshot message (Tag 35=W). Currently, the following SubscriptionRequestTypes (Tag 263) are available for Chart Data:

TIME_AND_SALES_DATA_BATCH (Tag 263=4): Covers requests over multiple days and a user-defined Session time span. This is the recommended SubscriptionRequestType.

TIME_AND_SALES_DATA (Tag 263=3): Covers requests over one single day and a user-defined Session time span. This is a subset of the TIME_AND_SALES_DATA_BATCH request type.

TIME_AND_SALES_CONTRACT (Tag 263=5): Covers requests over one single trade date for all markets of a contract. Total Volume Traded information is only provided.

TIME_AND_SALES_DATA_DAY (Tag 263=6): Covers requests over multiple trade dates.

Multiple day spans are defined with the fields TradeDateStart (Tag 3200) and TradeDateEnd (Tag 3201). A Session time-span can be specified with the fields SessionStartTime (Tag 3202) and SessionEndTime (Tag 3203). The (time) granularity of the returned responses can be controlled with the ChartType field (Tag 3204).

The Chart Data request can also control the compression/encoding of the its corresponding response. The DataFormat (Tag 3205) of COMPRESSED_TAGS will return all Chart Data tags as compressed and Base-64 encoded Tag-Value pairs in the EncodedText field (Tag 355) of the MarketData Snapshot message. Uncompressed responses explicitly provide the Chart Data Tag-Value pairs as part of the MDEntries repeating group of the MarketData Snapshot message.


Message Dictionary

TagField NameReq'dComments
Standard HeaderYMsgType = V
262MDReqIDYMust be unique. In order to unsubscribe, it may pertain to the MDReqID of a previous (subscription) Market Data Request.
263SubscriptionRequestTypeYSubscriptionRequestType indicates to the other party what type of response is expected. A snapshot request only asks for current information. A subscribe request asks for updates as the status changes. Unsubscribe will cancel any future update messages from the counter party. Valid values are:
0 = SNAPSHOT
1 = SUBSCRIBE: Enable Snapshot + Updates
2 = UNSUBSCRIBE: Disable previous Snapshot + Update Request
3 = TIMEANDSALES_DATA: Chart Data for a single Day with a customizable Session time span.
4 = TIMEANDSALES_DATA_BATCH: Chart Data for multiple trading days and a customizable Session time span. Recommended.
5 = TIMEANDSALES_DATA_CONTRACT: Chart Data for a single day. No customizable session time span. Responses are always uncompressed and only provide Total Traded Volume information.
6 = TIMEANDSALES_DATA_DAY: Chart Data for mutiple days. No customizable session time span.
264MarketDepthYRequested Depth of market for Subscription or Snapshot. T4 currently supports up to a maximum of 10 levels for selected markets. TopOfBookOnly = 1. FullBook = 10.
265MDUpdateTypeNSpecifies the type of Market Data throughput (buffering). Valid values are:
0 = Full Refresh. Equivalent to T4 Smart.
1 = Incremental Refresh. Equivalent to T4 Smart.
2 = T4 Slow Trade
3 = T4 Smart Trade
4 = T4 Slow Smart
5 = T4 Smart
6 = T4 Fast Smart
7 = T4 All
8 = T4 Fast Trade
9 = T4 Trade Only
Start Repeating Group
267NoMDEntryTypesYNumber of MDEntryType fields requested. Repeating Group.
269MDEntryTypeYThis is a list of interested Market Data Entries. Must be the first field in this repeating group. Valid values are:
0 = Bid
1 = Offer
2 = Implied Bid
3 = Implied Offer
4 = Last Trade
6 = Settlement
7 = Session High
8 = Session Low
K = Price High Limit
L = Price Low Limit
B = Trade Volume
End Repeating Group
Start Repeating Group
146NoRelatedSymYNumber of symbols (instruments) requested. Repeating Group.
55SymbolYSymbol. Must be the first field in this repeating group. This is the T4 Contract ID.
48SecurityIDYSecurity identifier. This is the T4 Market ID.
167SecurityTypeYInstrument type. Futures="FUT", Options="OPT", Stock="STK", Synthetic="SYN", Binary Option="BIN"
207SecurityExchangeYCan be used to identify the security. This is the T4 Exchange ID.
201PutOrCallNFor Options. Indicates whether an Option is for a put or call. Valid values are:
0 = Put
1 = Call
End Repeating Group
1070QuoteTypeNPricing Scheme for Quotes. Valid values are:
1 = Ticks
2 = Decimal
3200TradeDateStartNStart Date of multiple-day Chart Data request. Used for SubscriptionRequestTypes of TIMEANDSALES_DATA_BATCH (263=4) and TIMEANDSALES_DATA_DAY (263=6).
3201TradeDateEndNEnd Date of multiple-day Chart Data request. Used for SubscriptionRequestTypes of TIMEANDSALES_DATA_BATCH (263=4) and TIMEANDSALES_DATA_DAY (263=6).
3202SessionStartTimeNStart of Session for a user-defined time-span of a Chart Data request. Used for SubscriptionRequestTypes of TIMEANDSALES_DATA_BATCH (263=4) and TIMEANDSALES_DATA (263=3).
3203SessionEndTimeNEnd of Session for a user-defined time-span of a Chart Data request. Used for SubscriptionRequestTypes of TIMEANDSALES_DATA_BATCH (263=4) and TIMEANDSALES_DATA (263=3).
3204ChartTypeNChart Type as pertaining to the (time) granularity of Chart Data Snapshot responses. Valid values are:
0 = Tick
1 = Second
2 = Minute
3 = Hour
4 = Day
5 = Time Price Opportunity (TPO)
6 = Tick Change
3205DataFormatNThe compression format of the response to the Chart Data request. Not applicable to Contract Chart Data requests (263=5). Valid values are:
U = UNCOMPRESSED. All Chart Data is returned as tags included in the MDEntries repeating group of the Market Data Snapshot message.
T = COMPRESSED_TAGS. All Chart Data is returned as a payload of compressed and Base-64 encoded Tag-Value pairs in the EncodedText field (Tag 355) of the Market Data Snapshot message. Compression is implemented with the Lempel-Ziv-Huffman (Deflate) algorithm.
Standard TrailerY


Sample Messages

Subscribe to streaming data from a specific market

>> 10/10/2012 9:37:58 AM   [FIXMARKETDATAREQUEST] 34=1891|49=T4Example|56=T4|52=20121010-14:37:58.720|262=md-10/10/2012 9:37:58 AM|263=1|264=10|265=5|1070=1|267=3|269=0|269=1|269=2|146=1|55=ES|48=CME_20121200_ESZ2|167=FUT|207=CME_Eq|
[FIXMARKETDATAREQUEST]
[MsgSeqNum] 34 = 1891
[SenderCompID] 49 = T4Example
[TargetCompID] 56 = T4
[SendingTime] 52 = 20121010-14:37:58.720
[MDReqID] 262 = md-10/10/2012 9:37:58 AM
[SubscriptionRequestType] 263 = 1 (SNAPSHOT_PLUS_UPDATES)
[MarketDepth] 264 = 10
[MDUpdateType] 265 = 5 (SMART)
[MDQuoteType] 1070 = 1 (TICKS)
[NoMDEntryTypes] 267 = 3
[MDEntryType] 269 = 0 (BID)
[MDEntryType] 269 = 1 (OFFER)
[MDEntryType] 269 = 2 (IMPLIED_BID)
[NoRelatedSym] 146 = 1
[Symbol] 55 = ES
[SecurityID] 48 = CME_20121200_ESZ2
[SecurityType] 167 = FUT (FUTURE)
[SecurityExchange] 207 = CME_Eq

UnSubscribe from a currently streaming market

>> 10/10/2012 9:37:59 AM   [FIXMARKETDATAREQUEST] 34=1892|49=T4Example|56=T4|52=20121010-14:37:59.765|262=md-10/10/2012 9:37:59 AM|263=2|264=10|265=5|1070=1|267=3|269=0|269=1|269=2|146=1|55=ES|48=CME_20121200_ESZ2|167=FUT|207=CME_Eq|
[FIXMARKETDATAREQUEST]
[MsgSeqNum] 34 = 1892
[SenderCompID] 49 = T4Example
[TargetCompID] 56 = T4
[SendingTime] 52 = 20121010-14:37:59.765
[MDReqID] 262 = md-10/10/2012 9:37:59 AM
[SubscriptionRequestType] 263 = 2 (DISABLE_PREVIOUS_SNAPSHOT_PLUS_UPDATE_REQUEST)
[MarketDepth] 264 = 10
[MDUpdateType] 265 = 5 (SMART)
[MDQuoteType] 1070 = 1 (TICKS)
[NoMDEntryTypes] 267 = 3
[MDEntryType] 269 = 0 (BID)
[MDEntryType] 269 = 1 (OFFER)
[MDEntryType] 269 = 2 (IMPLIED_BID)
[NoRelatedSym] 146 = 1
[Symbol] 55 = ES
[SecurityID] 48 = CME_20121200_ESZ2
[SecurityType] 167 = FUT (FUTURE)
[SecurityExchange] 207 = CME_Eq

Chart Data Request (Uncompressed 1-minute bar for 2 minutes)

>> 1/22/2013 4:28:54 PM   [FIXMARKETDATAREQUEST] 34=19|49=T4Example|56=T4|52=20130122-22:28:54.373|262=mdc-1/22/2013 4:28:54 PM|263=4|264=1|265=5|1070=1|267=0|146=1|55=ZC|48=LVCME_20130700_ZCN3|167=FUT|207=LVCME_C|3200=20120926-16:14:00.000|3201=20120926-16:14:00.000|3202=20120926-16:12:00.000|3203=20120926-16:14:00.000|3204=2|3205=U|
[FIXMARKETDATAREQUEST]
[MsgSeqNum] 34 = 19
[SenderCompID] 49 = T4Example
[TargetCompID] 56 = T4
[SendingTime] 52 = 20130122-22:28:54.373
[MDReqID] 262 = mdc-1/22/2013 4:28:54 PM
[SubscriptionRequestType] 263 = 4 (TIMEANDSALES_DATA_BATCH)
[MarketDepth] 264 = 1
[MDUpdateType] 265 = 5 (SMART)
[MDQuoteType] 1070 = 1 (TICKS)
[NoMDEntryTypes] 267 = 0
[NoRelatedSym] 146 = 1
[Symbol] 55 = ZC
[SecurityID] 48 = LVCME_20130700_ZCN3
[SecurityType] 167 = FUT (FUTURE)
[SecurityExchange] 207 = LVCME_C
[TradeDateStart] 3200 = 20120926-16:14:00.000
[TradeDateEnd] 3201 = 20120926-16:14:00.000
[SessionStartTime] 3202 = 20120926-16:12:00.000
[SessionEndTime] 3203 = 20120926-16:14:00.000
[ChartType] 3204 = 2 (MINUTE)
[DataFormat] 3205 = U (UNCOMPRESSED)

FIX API Home Page.

Trade how you want, where you want

support@ctsfutures.com (312) 939 0164

2 Pierce Pl, Suite 200, Itasca, IL 60143

© 2009-2023 Cunningham Trading Systems LLC All rights reserved.